{% extends "blog/base_blog.html" %}
{% load markup %}

{% block title %}Post archive{% endblock %}
{% block body_class %}{{ block.super }} post_list{% endblock %}

{% block content_title %}
  <h2>Post archive</h2>
{% endblock %}

{% block content %}
  <div class="post_list">
    {% for post in object_list %}
    <div>
      <h1 class="title"><a href="{{ post.get_absolute_url }}">{{ post.title }}</a></h1>
      <div class="body">
        {{ post.body|safe }}
      </div>
      {% if post.more %}
        <div class="read_more">
          leia o artigo completo...
        </div>
      {% endif %}
      <p class="date">publicado em {{ post.published|date:"d \de F \de Y" }}</p>
    </div>
    {% endfor %}
  </div>
  
  {% if is_paginated %}
  <p class="pagination">
    {% if has_next %}
    <a class="older" href="?page={{ next }}">Older</a>
    {% endif %}
    {% if has_next and has_previous %} | {% endif %}
    {% if has_previous %}
    <a class="newer" href="?page={{ previous }}">Newer</a>
    {% endif %}
  </p>
  {% endif %}
{% endblock %}